<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:fbi="http://www.fbifaces.org"
                template="/templates/ui.xhtml">

<ui:define name="head">
    <style type="text/css">
        .input-col-m {
            width: 60px;
        }

        .input-col-l {
            width: 80px;
        }

        .input-col-xxl {
            width: 1%;
            text-align: right;
        }

        .col-95 {
            text-align: right;
        }

        .col-5 {
            text-align: left;
        }
    </style>
    <script type="text/javascript" src="#{request.contextPath}/UI/support/dialogwindow.js"/>
    <script type="text/javascript" language="javascript">
        document.onkeydown = function TabReplace() {
            if (event.keyCode == 13) {
                if (event.srcElement.tagName != 'BUTTON')
                    event.keyCode = 9;
            }
        }
    </script>

</ui:define>

<ui:define name="content">
<div style="margin:5px;" id="top">
<h:form id="qryForm">
<p:growl life="2000" id="msgs" showDetail="false"/>
<p:panel id="query" header="监管账号交易明细">
    <h:panelGrid columns="2" cellspacing="3" style="width:100%">
        <h:panelGrid columns="4" cellspacing="3" style="width:80%" columnClasses="col-95,col-5,col-95,col-5">
            <h:outputLabel value="账户名称："/>
            <h:inputText value="#{accountTradeDetlAction.acctname}" style="width:146px;"/>
            <h:outputLabel value="*账户号："/>
            <h:inputText value="#{accountTradeDetlAction.acctno}" required="true" requiredMessage="账号不能为空！"
                         style="width:146px;"/>
            <h:outputLabel value="起始日期："/>
            <p:calendar pattern="yyyy-MM-dd" id="begindate" readonly="true" mode="popup"
                        locale="zh_CN"
                        value="#{accountTradeDetlAction.beginDate}"></p:calendar>
            <h:outputLabel value="截止日期："/>
            <p:calendar pattern="yyyy-MM-dd" id="enddate" readonly="true" mode="popup"
                        locale="zh_CN"
                        value="#{accountTradeDetlAction.endDate}"></p:calendar>
        </h:panelGrid>
        <h:panelGrid style="width:20%">
            <p:commandButton style="margin-left:15px;width:90px" ajax="true"
                             action="#{accountTradeDetlAction.onBtnQueryClick}" id="btnQuery"
                             value="查询" update="msgs,pdt">
            </p:commandButton>
            <!--<p:commandButton ajax="false" id="resetBtn" value="Excel导出"
                             style="width:90px;margin-left:15px">
                <fbi:DataExporter titleName="监管账户交易明细" target="pdt" type="xls"
                                  fileName="account_Trade_Detl"
                                  excludeColumnsWidth="14,14,15,15,15,10,10,12,12,10,15,14,10,12,10"/>
            </p:commandButton>-->
        </h:panelGrid>
    </h:panelGrid>
</p:panel>
<p:ajaxStatus style="width:16px;height:16px;">
    <f:facet name="start">
        <h:graphicImage value="/images/ajaxloading.gif"/>
    </f:facet>
    <f:facet name="complete">
        <h:outputText value=""/>
    </f:facet>
</p:ajaxStatus>
<p:dataTable id="pdt" dynamic="true" selectionMode="single"
             value="#{accountTradeDetlAction.rsAccDetails}" var="record"
             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
             paginator="true" rows="15" paginatorPosition="bottom"
             rowsPerPageTemplate="100,50,30,15,5"
             emptyMessage="数据记录为空...">

    <p:column>
        <f:facet name="header">
            <h:outputText value="监管账号"/>
        </f:facet>
        <h:outputText value="#{record.accountCode}"></h:outputText>
    </p:column>

    <p:column>
        <f:facet name="header">
            <h:outputText value="监管账户"/>
        </f:facet>
        <h:outputText value="#{record.accountName}"/>
    </p:column>

    <p:column>
        <f:facet name="header">
            <h:outputText value="对方账号"/>
        </f:facet>
        <h:outputText value="#{record.toAccountCode}"></h:outputText>
    </p:column>
    <p:column>
        <f:facet name="header">
            <h:outputText value="对方账户名"/>
        </f:facet>
        <h:outputText value="#{record.toAccountName}"></h:outputText>
    </p:column>

    <p:column style="align:center;">
        <f:facet name="header">
            <h:outputText value="收支标志"/>
        </f:facet>
        <h:outputText style="text-align: center;"
                      value="#{flagStatusForMap.inoutFlagMap[record.inoutFlag]}"></h:outputText>
    </p:column>

    <p:column style="align:center;">
        <f:facet name="header">
            <h:outputText value="交易类型"/>
        </f:facet>
        <h:outputText style="text-align: center;"
                      value="#{flagStatusForMap.tradeTypeMap[record.tradeType]}"></h:outputText>
    </p:column>

    <p:column>
        <f:facet name="header">
            <h:outputText value="交易金额"/>
        </f:facet>
        <h:outputText style="float:right;" value="#{record.tradeAmt}">
            <f:convertNumber pattern="###,##0.00"/>
        </h:outputText>
    </p:column>
    <p:column>
        <f:facet name="header">
            <h:outputText value="交易后余额"/>
        </f:facet>
        <h:outputText style="float:right;" value="#{record.balance}">
            <f:convertNumber pattern="###,##0.00"/>
        </h:outputText>
    </p:column>
    <p:column style="text-align:center;">
        <f:facet name="header">
            <h:outputText value="交易时间"/>
        </f:facet>
        <h:outputText value="#{record.tradeDate}">
        </h:outputText>
    </p:column>
    <p:column style="text-align:center;">
        <f:facet name="header">
            <h:outputText value="状态标志"/>
        </f:facet>
        <h:outputText
                value="#{flagStatusForMap.actDetlStatusFlagMap[record.statusFlag]}"></h:outputText>
    </p:column>
    <p:column style="text-align:center;">
        <f:facet name="header">
            <h:outputText value="变更标志"/>
        </f:facet>
        <h:outputText
                value="#{flagStatusForMap.actDetlChangeFlagMap[record.changeFlag]}"></h:outputText>
    </p:column>
</p:dataTable>
</h:form>
</div>
</ui:define>
</ui:composition>